<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('member'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员管理</title>
<link href="templates/style/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="templates/js/jquery.min.js"></script>
<script type="text/javascript" src="templates/js/forms.func.js"></script>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/bootstrap/css/bootstrap-theme.min.css" >
<script src="/bootstrap/js/bootstrap.min.js" ></script>
</head>

<body>
<div class="topToolbar"> <span class="title"><?php echo $_SESSION['adminlevel'];?>会员管理</span> <a href="javascript:location.reload();" class="reload">刷新</a></div>
<form name="form" id="form" method="post" action="member_save.php">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable">
    <tr align="left" class="head">
      <td width="5%" height="36" class="firstCol"><input type="checkbox" name="checkid" id="checkid" onclick="CheckAll(this.checked);"></td>
      <td width="5%">ID</td>
      <?php if($_SESSION['adminlevel']==1){?>
      <td width="8%">头像</td>
      <td width="20%">用户标识</td>
      <td width="8%">微信昵称</td>
      
      <?php }?>
      <td width="10%">用户组</td>
      <td width="10%">微信地址</td>
      <td width="10%">注册时间</td>
      <td width="10%" class="endCol">操作</td>
    </tr>
    <?php

		$dopage->GetPage("SELECT * FROM `#@__user`");



		while($row = $dosql->GetArray())

		{
			$levelname="";
			if($row['level']!=''){
				if($row['level']=='1'){
					$levelname="<span class='label label-important'>初级代理</span>";
				}
				if($row['level']=='2'){
					$levelname="<span class='label label-success'>高级代理</span>";
				}
			}
			//sex
			$sex="";
			if($row['sex']=="1"){
				$sex="<span class='label label-warning'>男</span>   ";
			}
			if($row['sex']=="2"){
				$sex="<span class='label label-important'>女</span>  ";
			}
			//address	
			$address="";
			if($row['country']!=""){
				$address.=$row['country']."-";
			}
			if($row['province']!=""){
				$address.=$row['province']."-";
			}
			if($row['city']!=""){
				$address.=$row['city'];
			}
			
			if($row['is_admin']==="true"){
				$is_admin='<span class="label label-success">管理员</span>';
			}else{
				$is_admin="";
			}
			
		?>
    <tr align="left" class="dataTr">
      <td height="60" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php echo $row['id']; ?>" /></td>
      <td><?php echo $row['id']; ?></td>
      <?php if($_SESSION['adminlevel']==1){?>
      <td><span class="thumbs" style="width:64px;"><img src="<?php echo $row['avatar']; ?>" width="64" height="64" /></span></td>
      <td><?php echo $row['openid']; ?></td>
      <td><?php echo $sex.$row['nickname']?></td>
      <?php }?>
      <td><?php  echo $is_admin.'<br/>'.$levelname;?></td>
      <td><?php echo $address;?></td>
      <td class="number"><?php echo GetDateMk($row['regtime']); ?><br />
        <?php echo MyDate('H:i:s',$row['regtime']); ?></td>
      <td class="action endCol"><span><a href="member_update.php?id=<?php echo $row['id']; ?>">修改</a></span> | <span class="nb"><a href="member_save.php?action=del2&id=<?php echo $row['id']; ?>" onclick="return ConfDel(0)">删除</a></span></td>
    </tr>
    <?php

		}

		?>
  </table>
</form>
<?php



//判断无记录样式

if($dosql->GetTotalRow() == 0)

{

	echo '<div class="dataEmpty">暂时没有相关的记录</div>';

}

?>
<div class="bottomToolbar"><span class="selArea"><span>选择：</span> <a href="javascript:CheckAll(true);">全部</a> - <a href="javascript:CheckAll(false);">无</a> - <a href="javascript:DelAllNone('member_save.php');" onclick="return ConfDelAll(0);">删除</a></span> </div>
<div class="page"> <?php echo $dopage->GetList(); ?> </div>
<?php



//判断是否启用快捷工具栏

if($cfg_quicktool == 'Y')

{

?>
<div class="quickToolbar">
  <div class="qiuckWarp">
    <div class="quickArea"><span class="selArea"><span>选择：</span> <a href="javascript:CheckAll(true);">全部</a> - <a href="javascript:CheckAll(false);">无</a> - <a href="javascript:DelAllNone('member_save.php');" onclick="return ConfDelAll(0);">删除</a></span> <span class="pageSmall"> <?php echo $dopage->GetList(); ?> </span></div>
    <div class="quickAreaBg"></div>
  </div>
</div>
<?php

}

?>
</body>
</html>